<%--
  Created by IntelliJ IDEA.
  User: 南苼
  Date: 2021/7/6
  Time: 15:17
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<style>

</style>
<script src="../js/jquery-1.10.2.js"></script>
<link rel='stylesheet' href='../css/choose.css'>
<script>
  $(function(){
    var sum=0;
    var url="http://localhost:9090/Eventstar/cho";
      !function(){
        $(".d3_2").html(sum);
      $.ajax({
          url:url+"/find",
          success:function(obj){
            for(var i=0;i<obj.length;i++){
              var d="<a href='/Eventstar/cho/findq?bookname="+obj[i].bookname+"'>" +
                      "<div class='mg'>"+obj[i].bookname+"</div></a>";
              $(".xmg").append(d);
            }
          }
        })
      }();
      $(".xmg").delegate(".mg","click",function(){
            $(this).css("background","#F09C10");
      })
     $("td").click(function(){
      $("td").css("background","aliceblue");
      $("td").click(function(){
        $(this).css("background","#F09C10");
      });
    });
    $(".box").click(function(){
        if($(this).is(":checked")==true){
          sum++;

        }else{
          sum--;
        }
      $(".d3_2").html(sum);
    })
    $(".a1").click(function(){
        var r=$(".box");
        var zhi=[];
        for(var i=0;i<r.length;i++){
          if($(r[i]).is(":checked")==true){
            zhi.push($(r[i]).attr("qid"));
          }
        }
        var data=JSON.stringify(zhi);
        console.log(data);
        $.ajax({
          url:url+"/addtm",
          data:{"tm":data},
          success:function(obj){
            window.location.href =url+"/gettm"
          }
        })
    })
  })
</script>
<body>
<%@include file="../tou.jsp"%>
  <div class="xmg"></div>
<h2 style="margin-left: 120px">题库选题</h2>
<div id="d1">
  <table  id="btn1">
    <tr>
      <td>搜索：</td>
      <td colspan="5"><select>
        <option>题干</option>
        <option>出题人</option>
      </select><input type="text" placeholder="题干/出题人" /><input type="button" value="搜索" style="background-color: dodgerblue;"/></td>

    </tr>
    <tr>
      <td>题库</td>
      <td>全部</td>
      <td colspan="4"></td>
    </tr>
    <tr>
      <td>题型</td>
      <td>不限</td>
      <td>单选题</td>
      <td>多选题</td>
      <td>填空题</td>
      <td>判断题</td>
      <td>简答题</td>
    </tr>
    <tr>
      <td>类别</td>
      <td>不限</td>
      <td>百科知识</td>
      <td>教育考试</td>
      <td>行业知识</td>
      <td>资格证书</td>
      <td>趣味知识</td>
    </tr>
  </table>
</div>
<div id="d2">
  <div id="d3"><div class="d3_1"><img src="/Eventstar/img/examimg/img_6.png"/></div><div class="d3_2"></div></div>
  <div class="b1"><a class="a1" href="#">+全部加入考试</a></div>
  <div class="b2"><a href="http://localhost:9090/Eventstar/settings_zw/settings.jsp?URL=settings_zw/edit.jsp" class="a2">放弃选择并返回</a></div>
</div>
<div class="ctm">
  <c:forEach items="${findq}" var="t">
    <div class="title">
      <br>&emsp;
      <input type="checkbox" class="box"  name="inp" qid="${t.q_id}">&nbsp;<span class="timu">${t.q_name}</span>
      <br><br><span class="opt">A、</span>${t.q_a}
      <br><br><span class="opt">B、</span>${t.q_b}
      <br><br><span class="opt">C、</span>${t.q_c}
      <br><br><span class="opt">D、</span>${t.q_d}
      <br><br><span class="opt">答案：</span>${t.q_answer}
    </div>
  </c:forEach>
</div>
</body>
</html>
